package test;

import resoft.jeasyform.event.EventHandler;
import resoft.jeasyform.components.Window;
import resoft.jeasyform.components.Component;
import resoft.report.JReport;

import java.io.IOException;

/**
 * <p></p>
 * User: albert
 * Date: Sep 9, 2007
 * Time: 9:54:56 PM
 */
public class ContactPrintEvent implements EventHandler {
    public boolean execute(Window window, Component source, int eventType) {
        JReport jReport;
        try {
            jReport = new JReport("card.txt");
        } catch (IOException e) {
            window.setMessage("print template is not exists");
            return false;
        }
        jReport.setVariable("name","def例");
        jReport.setVariable("email","liguoyin@resoft.css.com.cn");
        jReport.print();
        return true;
    }
}
